package com.mangowang.module.main.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.mangowang.module.main.R;
import com.mangowang.module.main.bean.AllowSnListBean;

import java.util.List;

public class AllowSnAdapter extends BaseQuickAdapter<AllowSnListBean, BaseViewHolder> {

    public AllowSnAdapter(Context context, List<AllowSnListBean> dataList) {
        super(R.layout.item_allow_sn, dataList);
    }
    @Override
    protected void convert(BaseViewHolder helper, AllowSnListBean item) {
        helper.setText(R.id.tv_show_sn, item.getShowSnNumber())
                .setText(R.id.tv_total_message, item.getUseSnNumber() + "台可调拨/共" + item.getTotalSnNumber() + "台");
        if (item.getSelectedSnList().size() == 0) {
            helper.setText(R.id.tv_next, "点击选择");
        } else {
            helper.setText(R.id.tv_next, "已选" + item.getSelectedSnList().size() + "台");
        }
    }

}
